import { loadJSON } from "../../utils/index";
import echarts from "../../utils/lib/echarts";
import AfricaMap from "./africa.geo.json";
import AsiaMap from "./asia.geo.json";
import NorthAmericaMap from "./north-america.geo.json";
import OceaniaMap from "./oceania.geo.json";
import SouthAmericaMap from "./south-america.geo.json";
import EuropeMap from "./europe.geo.json";

function registMap(_echarts: typeof echarts) {
  _echarts.registerMap('Asia', loadJSON(AsiaMap))
  _echarts.registerMap('Europe', loadJSON(EuropeMap))
  _echarts.registerMap('NorthAmerica', loadJSON(NorthAmericaMap))
  _echarts.registerMap('Oceania', loadJSON(OceaniaMap))
  _echarts.registerMap('SouthAmerica', loadJSON(SouthAmericaMap))
  _echarts.registerMap('Africa', loadJSON(AfricaMap))
}

export default {
  registMap,
  AfricaMap: loadJSON(AfricaMap),
  AsiaMap: loadJSON(AsiaMap),
  NorthAmericaMap: loadJSON(NorthAmericaMap),
  OceaniaMap: loadJSON(OceaniaMap),
  SouthAmericaMap: loadJSON(SouthAmericaMap),
  EuropeMap: loadJSON(EuropeMap),
};
